﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="jelentkez.aspx.cs" Inherits="NEMProjectWebApp.Pages.Diak.jelentkezes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style4
        {
            height: 30px;
        }
        .style5
        {
            height: 83px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table>
        <tr>
            <td class="style4" valign="bottom">
                <asp:Label ID="TargyakLabel1" runat="server" Text="Tárgyak:"></asp:Label>
            </td>
            <td class="style4">
            </td>
            <td class="style4" valign="bottom">
                Felvett tárgyak:
            </td>
        </tr>
        <tr>
            <td rowspan="2" valign="top">
                <asp:ListBox ID="TargyakListBox1" runat="server" Height="200px" Width="250px" DataSourceID="SqlDataSource1"
                    DataTextField="TargyNeve" DataValueField="T_ID"></asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                    SelectCommand="SELECT * FROM [Targy] ORDER BY [TargyNeve]"></asp:SqlDataSource>
            </td>
            <td align="center" valign="top" class="style5">
                <asp:Button ID="TargyJelButton" runat="server" Text="Jelentkezés Tárgyra" OnClick="TargyJelButton_Click" />
            </td>
            <td rowspan="2" valign="top">
                <asp:ListBox ID="TanulotargyakListBox" runat="server" Height="200px" Width="250px"
                    DataSourceID="SqlDataSourceTargyak" DataTextField="TargyNeve" 
                    DataValueField="Targy_ID">
                </asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSourceTargyak" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                    SelectCommand="SELECT UserTargyKapcs.Targy_ID, Targy.TargyNeve FROM UserTargyKapcs INNER JOIN Targy ON UserTargyKapcs.Targy_ID = Targy.T_ID and UserTargyKapcs.User_ID = @User_ID">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="0" Name="User_ID" SessionField="User_ID" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                <asp:Button ID="TargyLeadButton" runat="server" Text="Tárgy leadása" OnClick="TargyLeadButton_Click" />
                <br />
                <br />
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td class="style4" valign="bottom" colspan="2">
                <asp:Label ID="TargyakLabel2" runat="server" Text="Felvehető Vizsgák:"></asp:Label>
            </td>
            <td>
                Felvett Vizsgák:
            </td>
        </tr>
        <tr>
            <td rowspan="2" valign="top">
                <asp:ListBox ID="TargyakVizsgaraListBox" runat="server" Height="200px" Width="250px"
                    DataSourceID="SqlDataSourceFelvehetőVizsgak" DataTextField="adatok" DataValueField="VI_ID">
                </asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSourceFelvehetőVizsgak" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                    
                    SelectCommand="SELECT VizsgaIdopont.VI_ID,( Targy.TargyNeve+' ' +VizsgaIdopont.Helyszin) as adatok FROM VizsgaIdopont INNER JOIN Targy ON VizsgaIdopont.Targy_ID = Targy.T_ID">
                </asp:SqlDataSource>
            </td>
            <td align="center" valign="top">
                &nbsp;
            </td>
            <td rowspan="2">
                <asp:ListBox ID="VizsgakListBox" runat="server" Height="200px" Width="250px" DataSourceID="SqlDataSourceVizsgák"
                    DataTextField="adatok" DataValueField="VIID"></asp:ListBox>
                <asp:SqlDataSource ID="SqlDataSourceVizsgák" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                    
                    SelectCommand="SELECT UserVizsgaKapcs.VizsgaIdo_ID as VIID,
' '+VizsgaIdopont.Helyszin + ' ' +Targy.TargyNeve as adatok
FROM UserVizsgaKapcs 
INNER JOIN VizsgaIdopont ON UserVizsgaKapcs.VizsgaIdo_ID = VizsgaIdopont.VI_ID 
INNER JOIN Targy ON VizsgaIdopont.Targy_ID = Targy.T_ID and UserVizsgaKapcs.User_ID = @User_ID">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="0" Name="User_ID" SessionField="User_ID" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                <asp:Button ID="ElesButton" runat="server" Text="Vizsga Jelentkezés" OnClick="ElesButton_Click" />
                <br />
                <br />
                <br />
                <br />
                <asp:Button ID="ElesLeadButton" runat="server" Text="Vizsga Leadás" OnClick="ElesLeadButton_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
